import { ApiProperty } from '@nestjs/swagger';
import { Gender } from '@prisma/client';

// User response DTO
export class UserResponseDto {
  @ApiProperty({ description: 'User ID' })
  id: string;

  @ApiProperty({ description: 'Email' })
  email: string;

  @ApiProperty({ description: 'Phone number', required: false, nullable: true })
  phone?: string | null;

  @ApiProperty({ description: 'Gender', enum: Gender })
  gender: Gender;

  @ApiProperty({ description: 'Nickname', required: false, nullable: true })
  nickname?: string | null;

  @ApiProperty({ description: 'Avatar', required: false, nullable: true })
  avatar?: string | null;

  @ApiProperty({ description: 'Created time (Beijing timezone)', example: '2025-09-24T15:06:30.123+08:00' })
  createdAt: string;

  @ApiProperty({ description: 'Updated time (Beijing timezone)', example: '2025-09-24T15:06:30.123+08:00' })
  updatedAt: string;
}

// Authentication response DTO
export class AuthResponseDto {
  @ApiProperty({ description: 'Access token' })
  accessToken: string;

  @ApiProperty({ description: 'Token type', example: 'Bearer' })
  tokenType: string;

  @ApiProperty({ description: 'Token expiration time (seconds)', example: 3600 })
  expiresIn: number;

  @ApiProperty({ description: 'User information', type: UserResponseDto })
  user: UserResponseDto;
}
